<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>margin的注意事项三</title>
    <style>
        .d1 {
          width: 300px;
          height: 300px;
          background-color: blue;
          margin: 40px;
        }
        img {
          height: 50px;
          margin: 40px;
        }
        span {
          background-color: red;
          margin-left: 20px;
        }
    </style>
</head>
<body>
<!-- 结论: margin对于块元素和行内块元素都能设置上下左右的外边距 但对于行内元素 margin只能设置左右边距 -->
    <div class="d1">
      <span>你好</span>
    </div>
  <img src="../images/灰太狼.jpg" alt="灰太狼">
</body>
</html>